<extend name="Base/base" />
<block name='head'>
    <meta charset="utf-8">
    <link href="/Public/Index/css/workflow.css" rel="stylesheet" /> 
    <link href="/Public/Index/css/form.css" rel="stylesheet" />
    <!--文件上传-->
    <script type="text/javascript" src="__PUBLIC__/Cropper/js/ajaxfileupload.js" ></script>
    <style>
        .content{padding-bottom:2em}
        .feedback,.uploadFile{text-align: left;font-size:1.2em;margin-left:1em}
        .form .table_bg tr td{padding:0.2em}
        .form .table_bg tr td{font-size:1.2em}
        .form .table_bg tr .text_td{width:18%}
        .form .table_bg tr .text_value{width:80%}
        .feedback .f_div{border-bottom:1px solid #999;margin:0.5em 0;}
        .feedback .f_div .f_tit{font-weight:bold}
        .feedback .f_div .f_con{color:#666}
        .feedback table{width:100%;border:1px solid #999;border-collapse: collapse;}
        .feedback table tr td{border:1px solid #999;padding:0.3em 1em}
        .feedback table tr td .lists{margin-bottom:1em}
    </style>
</block>
<block name="content" > 
    <div class="workflow">
        <div class="content">
            <div class="form">
                <if condition="$run_id neq null">
                    {$form.print_model}
                    <else />
                    {$form.print_model}
                </if>
            </div>
            <notempty name="uploads">
                <div class="uploadFile">
                    <h2>公共附件</h2>
                        <foreach name="uploads" item="row" key="key">
                            <span style="display:block;padding:0.5em 0 0.3em 0">
                                <a href="{$row.upload}" download="{$row.name}">{$key+1}. {$row.name}</a>
                                <!--<img src="/Public/Index/img/close.png" class="pointer delfile" data-fileurl="{$row.upload}"/>-->
                            </span>
                        </foreach>
                </div>
            </notempty>
            <!--会签与点评-->
            <div class="feedback">
                <h2>会签与点评</h2>
                <foreach name="feeds" item="feed">
                    <div class="f_div">
                        <div class="f_tit">第{$feed.prcs_id}步【会签】 {$feed.prcs_name} {$feed.user_id|getChinesename}</div>
                        <div class="f_con">{$feed.content} {$feed.edit_time}</div>
                    </div>
                </foreach>
            </div>

            <!--流程图-->
            <div class="feedback">
                <h2>流程图</h2>
                <table>
                    <foreach name="process" item="row">
                        <notempty name="row.data">
                            <tr>
                                <td>第<b><font color="red">{$row.id}</font></b>步</td>
                                <td>序号{$row.prcs_id}：{$row.prcs_name}</td>
                                <td>
                            <foreach name="row.data" item="row1">
                                <div class="lists">
                                    <div>
                                        <if condition="$row1[prcs_flag] eq 4">
                                            <img src="/Public/Index/img/down.png">
                                            <elseif condition="$row1[prcs_flag] eq 1"/>
                                            <img src="/Public/Index/img/email-close.png">
                                            <else/>
                                            <img src="/Public/Index/img/email-open.png">
                                        </if>
                                        <font color="red">{$row1.user_id|getChineseName} {$row1['op_flag'] ? '主办' : '经办'}</font>
                                        <font color="green">[{$row1.prcs_flag|getFlagname} 
                                        <if condition="$row1['dec'] neq null">
                                            &nbsp;用时：<if condition="$row1['dec']['day'] neq 0">{$row1['dec']['day']}天</if><if condition="$row1['dec']['hour'] neq 0">{$row1['dec']['hour']}小时</if><if condition="$row1['dec']['min'] neq 0">{$row1['dec']['min']}分</if>{$row1['dec']['sec']}秒
                                        </if>
                                        ]</font>
                                    </div>
                                    <div>开始于：{$row1.prcs_time}</div>
                                    <div>结束于：{$row1.deliver_time}</div>
                                </div>
                            </foreach>
                            </td>
                            </tr>
                        </notempty>
                    </foreach>

                </table>
            </div>

            <input type="hidden" name="FORM_ID" value="{$form_id}">
            <input type="hidden" name="RUN_ID" value="{$run_id}">
            <input type="hidden" name="PRCS_ID" value="{$prcs}">
            <input type="hidden" name="FLOW_ID" value="{$info.flow_id|default=0}">
     
        </div>

        <div class="button" id="button">
            <input type="hidden" id="url" value="{:U('getRunData',array('run_id'=>$run_id,'flow_id'=>$flow_id))}">
            <input type="hidden" id="feedbackUrl" value="{:U('getRunData',array('type'=>'feedback','run_id'=>$run_id))}">
            <a class="am-btn" onclick="history.go(-1)">返 回</a>
        </div>
    </div>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Index/js/form.js"></script>
    <script type="text/javascript">
                $(function () {
                    $('.form table .text_value span').text('');
                })
                {$form.script}
                $(initUpload("{:U(CONTROLLER_NAME.'/upload')}"));
                $(initFormData())
    </script>
</block>
